package dao;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import org.apache.log4j.Logger;

import db.DbController;


public class DbApprovings {

 
    ////////////////////////
    public static int insert(int wordID, int userID, String strMeaning) {
    	
    	Connection cnn = null;
        CallableStatement cstat = null;
        
        try {
            cnn = DbController.getConnection();
            cstat = cnn.prepareCall("{call m_approvings_insert(?,?,?)}");
            cstat.setInt(1, wordID);
            cstat.setInt(2, userID);
            cstat.setString(3, "N'" + strMeaning + "'");
            
            return cstat.executeUpdate();
        }
        
        catch (SQLException e) {
			// TODO: handle exception
        	return 0;
		}       
    }
    
    public static int delete(int userID, int dictID) {
    	delete from m_managerindict where m_userID=" + manaID
            + " and m_dictID=" + dictID
    }
}
